//
//  ICMessageSocketManager.m
//  ICome
//
//  Created by zhangrongwu on 2017/7/6.
//  Copyright © 2017年 iCom. All rights reserved.
//

#import "ICMessageSocketManager.h"

@implementation ICMessageSocketManager

+(instancetype)sharedInstance {
    static ICMessageSocketManager *manager;
    static dispatch_once_t once;
    dispatch_once(&once, ^{
        manager = [[ICMessageSocketManager alloc] init];
    });
    return manager;
}


-(void)tdoReadChangeStatusParam:(NSDictionary *)param
                     identifier:(NSString *)identifier
                        Success:(SendSuccessCompletionHandle)success
                        Failure:(SocketFailureCompletionHandle)failure {
    NSDictionary *body = [self packageRequestObject:param Api:MESSAGE_TDOREAD];
    [[ICSocketCommunicationManager sharedInstance] requestWithRequestType:SCRequestType_Normal requestBody:body Identifier:identifier completion:^(id data, NSError *error, id other) {
        if (requestSuccess) {
            success(data, other);
        } else {
            failure(error, other);
        }
    }];
}

//-(void)getFromInfoWithParam:(NSDictionary *)param
//                 identifier:(NSString *)identifier
//                    Success:(SendSuccessCompletionHandle)success
//                    Failure:(SocketFailureCompletionHandle)failure {
//    NSDictionary *body = [self packageRequestObject:param Api:GROUP_FROMINFO];
//    [[ICSocketCommunicationManager sharedInstance] requestWithRequestType:SCRequestType_Normal requestBody:body Identifier:identifier completion:^(id data, NSError *error, id other) {
//        if (requestSuccess) {
//            NSDictionary *object = [data objectForKey:@"data"];
//            success(object, other);
//        } else {
//            if (failure) {
//                failure(error, other);
//            }
//        }
//    }];
//}
@end
